home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / BlobMgr / Blob Manager Demo 4 / DemoWind.c < prev   
Encoding:
C/C++ Source or Header  |  1987-02-17  |  997 b   |  58 lines  |  [TEXT/MACA]

  1. /*
  2.     Blob Manager Demonstration:  Window routines
  3. */
  4.  
  5. # include    "BlobDemo.h"
  6. # include    <WindowMgr.h>
  7.  
  8.  
  9.  
  10.  
  11. /*
  12.     Get a window for a demo module.  Pass the resource number of the
  13.     window.  Set the font to Chicago 12-point, and add the window's
  14.     title to the Windows menu.
  15. */
  16.  
  17. GrafPtr GetDemoWind (resNum)
  18. int        resNum;
  19. {
  20. GrafPtr    thePort;
  21.  
  22.     thePort = (GrafPtr) GetNewWindow (resNum, nil, -1L);
  23.     SetPort (thePort);
  24.     TextFont (0);
  25.     TextSize (0);
  26.     return (thePort);
  27. }
  28.  
  29.  
  30. /*
  31.     Generic window handler clobber proc for TransSkel stuff
  32. */
  33.  
  34. DoWClobber ()
  35. {
  36. WindowPtr    theWind;
  37.  
  38.     GetPort ((GrafPtr *) &theWind);
  39.     CloseWindow (theWind);                /* should be DisposeWindow? */
  40. }
  41.  
  42.  
  43. /*
  44.     Set window's default blob dragging rects:  limit rect is portRect
  45.     of window's grafPort, slop rect is wide open rectangle.
  46. */
  47.  
  48. SetDragRects (thePort)
  49. GrafPtr    thePort;
  50. {
  51. Rect    rSlop;
  52.  
  53.     SetRect (&rSlop, -30000, -30000, 30000, 30000);
  54.     SetBDragRects (&thePort->portRect, &rSlop);
  55. }SHAR_EOF
  56. exit
  57. /* End of text from uiucdcsb:mod.mac.sources */
  58.